#ifndef QTOOLLINE_H
#define QTOOLLINE_H

#include <QObject>
#include <QTcpSocket>
#include <QDebug>
#include <QThread>
#include <QMutex>

class QLineTools: public QObject
{
    Q_OBJECT
public:
    QLineTools(QString ip = "127.0.0.1", uint16_t prot = 6101);
    ~QLineTools();

    QString ip() const;
    void setIp(const QString &ip);

    uint16_t prot() const;
    void setProt(const uint16_t &prot);

signals:
    void Result(QString log, int c);
    void IsLine(bool b);

private:
    QString m_ip = "127.0.0.1";
    uint16_t m_prot = 6101;
    QTcpSocket *m_scket;
    QMutex m_Mutex;
    bool isLine = false;

public slots:
    void SendData(QString s);
    void ConnectDev();
    void DisconnectDev();
};

#endif // QTOOLLINE_H
